/**
 * @date   2011-5-1
 * @author tianye
 */
package cn.edu.dlut.WingGame.Game;

import cn.edu.dlut.WingGame.Object.WingObject;
import cn.edu.dlut.WingGame.Tools.ObjectContainer;

public class WingSceneContainer {
	public WingObject currentScene = null;
	public ObjectContainer mObject;

	public WingSceneContainer() {
		mObject = new ObjectContainer();
	}

	public boolean addScene(WingObject scene) {
		return mObject.addObject(scene);
	}

	public WingObject getScene(int id) {

		return mObject.getObjectByID(id);
	}

	public WingObject getScene(String name) {

		return mObject.getObjectByID(WingObject.NameToID(name));
	}

	public void update() {
		if (currentScene != null)
			currentScene.update();
	}

	public void render() {
		if (currentScene != null)
			currentScene.render();
	}

	public void setCurrentScene(String scenename) {
		currentScene = mObject.getObjectByID(WingObject.NameToID(scenename));
	}

	public void setCurrentScene(int id) {
		currentScene = mObject.getObjectByID(id);
	}

	public WingObject getCurrentScene() {
		return currentScene;
	}
}
